#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Purpose: bb-freeze file
# Created: 12/01/2008
# Copyright (c) 2008,2009 by University College London
# Authors:
# Didrik Pinte <dpinte@dipole-consulting.com>
#
# This program is free software under the GPL (>=v2)
# Read the file COPYING coming with HydroPlatform for details.

from bbfreeze import Freezer
import sys
import wxversion

wxversion.select("2.8")

# FIXME : hardcorded path to Thuban extension
sys.path.append("c:/build/thuban/thuban/")
sys.path.append("c:/build/thuban/thuban/lib")
# added for missing dll's of wx needed during the freezing
sys.path.append("C:/Python25/Lib/site-packages/wx-2.8-msw-unicode/wx")

'''
geos.dll seems missing when running the freeze

After the freeze must add Thuban Extension directory 
and merge HydroPlatform and Thuban Resources directory
'''

if __name__ == "__main__":
    print "Freezing hydroplatform"
    f = Freezer("hydroplatform-1.0",
                   includes=("sqlalchemy", "networkx", "sqlite3", 
                             "gdalconst", "gdal", "wx.lib.gridmovers", "wx.lib.mixins.listctrl",
                             "Thuban", "wxproj", "Projection", "gdalwarp", 
                             "dbflib", "shapelib", "shptree", "xlwt",
                             "owslib"),
                   excludes=('Tkinter', 'Tkconstants', 'tcl', '_tkinter', 'matplotlib', 'numpy.f2py'), 
                )
    # second argument is GUI-only
    f.addScript("hydroplatform.py", False)
    f()
    print "Done"